package cn.dkk.create_design.builder.ConsturctorBuilder;

import cn.dkk.create_design.builder.BikeBuilder;

/**
 * @author dkk
 * @date 2022/7/10
 * @desc 再写一次加深印象
 */
public class Computer {

    private String memory;

    private String cpu;

    private String screen;

    private String mainBoard;

    private Computer(){
    }

    private Computer(Builder builder){
        memory=builder.memory;
        cpu=builder.cpu;
        screen=builder.screen;
        mainBoard=builder.mainBoard;
    }

    static final class Builder{

        private String memory;

        private String cpu;

        private String screen;

        private String mainBoard;

        public Builder memory(String memory){
            this.memory=memory;
            return this;
        }

        public Builder cpu(String cpu){
            this.cpu=cpu;
            return this;
        }

        public Builder screen(String screen){
            this.screen=screen;
            return this;
        }

        public Builder mainBoard(String mainBoard){
            this.mainBoard=mainBoard;
            return this;
        }

        public Computer build(){
            return new Computer(this);
        }

    }

    @Override
    public String toString() {
        return "Computer{" +
                "memory='" + memory + '\'' +
                ", cpu='" + cpu + '\'' +
                ", screen='" + screen + '\'' +
                ", mainBoard='" + mainBoard + '\'' +
                '}';
    }

    public String getMemory() {
        return memory;
    }

    public void setMemory(String memory) {
        this.memory = memory;
    }

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public String getScreen() {
        return screen;
    }

    public void setScreen(String screen) {
        this.screen = screen;
    }

    public String getMainBoard() {
        return mainBoard;
    }

    public void setMainBoard(String mainBoard) {
        this.mainBoard = mainBoard;
    }
}
